<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link href="/resource/css/admin/main.css" type="text/css" rel="stylesheet" />
<link href="/resource/css/admin/right.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/resource/js/jquery.js"></script>
<script type="text/javascript" src="/resource/js/base.js"></script>
</head>
<body>
	<div class="position"><span>您的当前位置：</span>组织机构 > 部门管理</div>
	<div class="rightbody f">
		<div class="rightbodycontent">
		    <table class="tools">
		        <tr>
		            <td align="right">
		                <a href="edit" class="linkbtn insert">新建部门</a>
		            </td>
		        </tr>
		    </table>
		    <table cellspacing="1" cellpadding="4" class="tablelist">
		        <tr>
		            <th width="20%">部门名称</th>
				    <th>URL目录</th>
				    <th>数据模型</th>
				    <th>模板</th>
				    <th>对应人数</th>
				    <th>排序</th>
				    <th>占用状态</th>
				    <th>操作</th>
		        </tr>
		        <#list departments as department>
		        	<#assign isuse = department.admins?size gt 0 || department.dataitemReDepartments?size gt 0>
					<tr<#if department_index % 2 == 1> class="splittr"</#if>>
						<td align="center">${department.name}</td>
					    <td align="center">${department.urldirectory!}</td>
					    <td align="center"><#if department.datamodel??>${department.datamodel.name}</#if></td>
					    <td align="center">${department.template!}</td>
					    <td align="center">${department.admins?size}</td>
					    <td align="center">${department.sort}</td>
					    <td align="center"><img src="/resource/image/admin/main/right/ico/${isuse?string("use","free")}.png" /></td>
					    <td align="center">
						    <a href="edit?departmentid=${department.id}" class="linkbtn update noborder">修改</a>
							<a<#if !isuse> href="delete?departmentid=${department.id}"</#if> class="linkbtn delete noborder<#if isuse> gray</#if>" onclick="${isuse?string("alert('该单位当前被内容模块或者用户占用，无法删除'); return false;","return confirm('确定删除吗？')")}">删除</a>
					    </td>
		            </tr>
		        </#list>
		    </table>
	    </div>
    </div>
</body>
</html>